﻿using System.Diagnostics.Contracts;
using System.Linq.Expressions;

namespace System.Reactive.Linq
{
	[ContractClass(typeof(IQbservableContract))]
	public interface IQbservable
	{
		Type ElementType { get; }
		Expression Expression { get; }
		IQbservableProvider Provider { get; }
	}

	[ContractClassFor(typeof(IQbservable))]
	internal abstract class IQbservableContract : IQbservable
	{
		public Type ElementType
		{
			get
			{
				Contract.Ensures(Contract.Result<Type>() != null, null, "Contract.Result<Type>() != null");
				return null;
			}
		}

		public Expression Expression
		{
			get
			{
				Contract.Ensures(Contract.Result<Expression>() != null, null, "Contract.Result<Expression>() != null");
				return null;
			}
		}

		public IQbservableProvider Provider
		{
			get
			{
				Contract.Ensures(Contract.Result<IQbservableProvider>() != null, null, "Contract.Result<IQbservableProvider>() != null");
				return null;
			}
		}
	}
}